Skip to content

Make native event type cache prototype-safe - #58203

Open
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-native-event-type-cache-keys
Open

Make native event type cache prototype-safe#58203
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-native-event-type-cache-keys

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary:

The EventTarget declarative-prop cache is an ordinary object, so event names such as constructor resolve inherited Object properties as cached entries and silently skip their registered handler. Use a typed Map for exact event-name keys and add a custom native direct-event regression.

Fixes #58202.

Changelog:

[GENERAL] [FIXED] - Resolve native EventTarget names that overlap Object prototype properties.

Test Plan:

  • Exact baseline regression expected onConstructor and received undefined; fixed test passes 1/1.
  • Focused Jest suite passed.
  • Fresh yarn flow-check: 0 errors.
  • Targeted ESLint, Prettier, and git diff --check passed.

No UI change; screenshots are not applicable.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 30, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native EventTarget cache treats Object properties as event entries

1 participant